//package com.wst.system.config.sharding.config;
//
//
//import com.wst.system.util.SnowFlakeUtil;
//import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue;
//import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm;
//
//import java.text.SimpleDateFormat;
//import java.util.Collection;
//import java.util.Date;
//
///**
// * @Classname SnowFlakeLogShard
// * @Description TODO
// * @Date 2023/2/23 16:08
// * @Created by XiongXiong
// * @Author: X.I.O
// */
//public class SnowFlakeLogShard implements PreciseShardingAlgorithm<Long> {
//
//    @Override
//    public String doSharding(Collection<String> collection, PreciseShardingValue<Long> preciseShardingValue) {
//        Long id = (Long) preciseShardingValue.getValue();
//        // 如果 id 是 string ，可以 id.hashcode()
//        Date date= SnowFlakeUtil.getTimeBySnowFlakeId(id);
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
//        String tableName="log_"+sdf.format(date);
//        return tableName;
//    }
//}
